3.4.40 \(\int \frac {\cot (e+f x)}{a+b \sec ^2(e+f x)} \, dx\) [340]

Optimal. Leaf size=46 \[ \frac {b \log \left (b+a \cos ^2(e+f x)\right )}{2 a (a+b) f}+\frac {\log (\sin (e+f x))}{(a+b) f} \]

[Out]

1/2*b*ln(b+a*cos(f*x+e)^2)/a/(a+b)/f+ln(sin(f*x+e))/(a+b)/f

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4223, 457, 78} \begin {gather*} \frac {\log (\sin (e+f x))}{f (a+b)}+\frac {b \log \left (a \cos ^2(e+f x)+b\right )}{2 a f (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

(b*Log[b + a*Cos[e + f*x]^2])/(2*a*(a + b)*f) + Log[Sin[e + f*x]]/((a + b)*f)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4223

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, Dist[-(f*ff^(m + n*p - 1))^(-1), Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*
(ff*x)^n)^p/x^(m + n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\cot (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {x^3}{\left (1-x^2\right ) \left (b+a x^2\right )} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\text {Subst}\left (\int \frac {x}{(1-x) (b+a x)} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {1}{(-a-b) (-1+x)}-\frac {b}{(a+b) (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=\frac {b \log \left (b+a \cos ^2(e+f x)\right )}{2 a (a+b) f}+\frac {\log (\sin (e+f x))}{(a+b) f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 43, normalized size = 0.93 \begin {gather*} \frac {2 a \log (\sin (e+f x))+b \log \left (a+b-a \sin ^2(e+f x)\right )}{2 a^2 f+2 a b f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

(2*a*Log[Sin[e + f*x]] + b*Log[a + b - a*Sin[e + f*x]^2])/(2*a^2*f + 2*a*b*f)

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 68, normalized size = 1.48

method result size
derivativedivides \(\frac {\frac {b \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 \left (a +b \right ) a}+\frac {\ln \left (\cos \left (f x +e \right )-1\right )}{2 a +2 b}+\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) \(68\)
default \(\frac {\frac {b \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 \left (a +b \right ) a}+\frac {\ln \left (\cos \left (f x +e \right )-1\right )}{2 a +2 b}+\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) \(68\)
risch \(\frac {i x}{a}-\frac {2 i x}{a +b}-\frac {2 i e}{f \left (a +b \right )}-\frac {2 i b x}{a \left (a +b \right )}-\frac {2 i b e}{a f \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{f \left (a +b \right )}+\frac {b \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{2 a f \left (a +b \right )}\) \(125\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)/(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(1/2/(a+b)*b/a*ln(b+a*cos(f*x+e)^2)+1/(2*a+2*b)*ln(cos(f*x+e)-1)+1/(2*a+2*b)*ln(1+cos(f*x+e)))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 52, normalized size = 1.13 \begin {gather*} \frac {\frac {b \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{2} + a b} + \frac {\log \left (\sin \left (f x + e\right )^{2}\right )}{a + b}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*(b*log(a*sin(f*x + e)^2 - a - b)/(a^2 + a*b) + log(sin(f*x + e)^2)/(a + b))/f

________________________________________________________________________________________

Fricas [A]
time = 3.91, size = 44, normalized size = 0.96 \begin {gather*} \frac {b \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + 2 \, a \log \left (\frac {1}{2} \, \sin \left (f x + e\right )\right )}{2 \, {\left (a^{2} + a b\right )} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*(b*log(a*cos(f*x + e)^2 + b) + 2*a*log(1/2*sin(f*x + e)))/((a^2 + a*b)*f)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot {\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)**2),x)

[Out]

Integral(cot(e + f*x)/(a + b*sec(e + f*x)**2), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 166 vs. \(2 (44) = 88\).
time = 0.49, size = 166, normalized size = 3.61 \begin {gather*} \frac {\frac {b \log \left (a + b + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{2} + a b} + \frac {\log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right )}{a + b} - \frac {2 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

1/2*(b*log(a + b + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(
cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/(a^2 + a*b) + log(abs(
-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1))/(a + b) - 2*log(abs(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1))/a)/
f

________________________________________________________________________________________

Mupad [B]
time = 4.70, size = 65, normalized size = 1.41 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )}{f\,\left (a+b\right )}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a\,f}+\frac {b\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}{2\,f\,\left (a^2+b\,a\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)/(a + b/cos(e + f*x)^2),x)

[Out]

log(tan(e + f*x))/(f*(a + b)) - log(tan(e + f*x)^2 + 1)/(2*a*f) + (b*log(a + b + b*tan(e + f*x)^2))/(2*f*(a*b
+ a^2))

________________________________________________________________________________________